package com.tyrone.leetcode.util;

import com.alibaba.fastjson.JSON;


import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author yelong.xie
 * @date 2024/3/16 18:34
 */
public class CodeUtils {
    public static int[][] toDoubleArray(String json){
        List<List> list = JSON.parseArray(json, List.class);
        int n = list.get(0).size();
        int m = list.size();
        int[][] arr =new int[m][n];
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < n; j++) {
                arr[i][j] = (int) list.get(i).get(j);
            }
        }
        return arr;
    }
}
